namespace Skymate.Commands
{
    public class TimingPlanPhase
    {
        /// <summary>
        /// 相位号
        /// </summary>
        public int No { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        public int Time { get; set; }

        public static TimingPlanPhase Create(byte[] buffer)
        {
            var result = new TimingPlanPhase { No = buffer[0], Time = buffer[1] };
            return result;
        }

        public byte[] ToBytes()
        {
            var result = new byte[2];
            result[0] = (byte)this.No;
            result[1] = (byte)this.Time;
            return result;
        }

        public override string ToString()
        {
            return this.Time.ToString();
        }
    }
}